//--------------------------------------------------------------------------------------
// File: OMPexp.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=320437
//--------------------------------------------------------------------------------------

#ifdef _MSC_VER
#pragma once
#endif

#ifndef KMP_EXP_H
#define KMP_EXP_H

#include "xomp_exp.h"

#if defined(_MSC_VER) && (defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) || defined(_M_ARM) || defined(_XBOX_ONE) || defined(_M_PPC))
// Exclude rarely-used stuff from Windows headers
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef STRICT
#define STRICT
#endif

#ifndef _WINDOWS_
# pragma warning( push )
#if __INTEL_COMPILER
# pragma warning( disable: 271 310 )
#elif _MSC_VER
#pragma warning(disable : 4005)
#endif
# include <windows.h>
# pragma warning( pop )
#endif

// If app hasn't choosen, set to work with Windows 8 and beyond
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
#if defined(_WIN32_WINNT) && (_WIN32_WINNT < _WIN32_WINNT_WIN8)
#undef _WIN32_WINNT
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT   _WIN32_WINNT_WIN8
#endif
#ifndef WINVER
#define WINVER         _WIN32_WINNT
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS _WIN32_WINNT
#endif
#endif

#endif

#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#define EXTERN_CC_BEGIN extern "C++" {
#define EXTERN_CC_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#define EXTERN_CC_BEGIN
#define EXTERN_CC_END
#endif

#ifdef __cplusplus
EXTERN_C_BEGIN
#endif

#ifdef __cplusplus
EXTERN_C_END
#endif

#ifdef __cplusplus
#ifndef _EXTERNC
#define _EXTERNC extern "C"
#endif
#ifndef _EXTERNCC
#define _EXTERNCC extern "C++"
#endif
#ifndef _EXTERN
#define _EXTERN extern
#endif
#else
#ifndef _EXTERN
#define _EXTERN extern
#endif
#endif

#ifdef __cplusplus
#define KMP_EXTERNC extern "C"
#define KMP_EXTERNCC extern "C++"
#define KMP_EXTERN extern
#else
#define KMP_EXTERNC extern
#define KMP_EXTERNCC extern
#define KMP_EXTERN extern
#endif


#if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) || defined(_M_ARM) || defined(_XBOX_ONE) || defined(_M_PPC)

#if defined(LIB_EXPORTS) || defined( KMPLIB_EXPORTS)
#ifndef KMPLIB_IMPORTS
#ifndef KMPLIB_EXPORTS
#define KMPLIB_EXPORTS 1
#endif
#endif
#endif

#if defined(LIB_IMPORTS) || defined( KMPLIB_IMPORTS)
#if defined( KMPLIB_EXPORTS)
# pragma error ("!!!You are bulding OMP export and import simultaniously")
#else
#ifndef KMPLIB_IMPORTS
#define KMPLIB_IMPORTS 1
#endif
#endif
#endif

#if defined(LIB_STATIC) || defined( KMPLIB_STATIC)
#ifndef KMPLIB_DLL
#ifndef KMPLIB_STATIC 
#define KMPLIB_STATIC 1
#endif
#endif
#endif


#if (defined(_DLL) || defined(_USRDLL) || defined(_WINDLL) || defined(LIB_DYNAMIC) || defined( KMPLIB_DLL)) && !defined(_LIB) && !defined( KMPLIB_STATIC)
#ifndef KMPLIB_STATIC
#ifndef KMPLIB_DLL
#define KMPLIB_DLL 1
#endif
#endif
#endif

#if !defined( KMPLIB_DLL) && !defined( KMPLIB_STATIC)
# pragma error ("!!!Your OMP lib type static or dll aren't defined")
#endif


#  if defined( KMPLIB_DLL) && !defined( KMPLIB_STATIC)
#    if defined(_MSC_VER)
#      if defined( KMPLIB_EXPORTS)
#		ifndef GUIDEDLL_EXPORTS
#			define GUIDEDLL_EXPORTS 1
#		endif
#        define KMP_EXPAPI XOMP_EXPAPI
#      elif defined ( KMPLIB_IMPORTS)
#        define KMP_EXPAPI XOMP_EXPAPI
#      else // KMPLIB_STATIC  _LIB
#        define KMP_EXPAPI 
#      endif
#	 else  // KMPLIB_LIB
#      define KMP_EXPAPI 
#    endif
#  else  // KMPLIB_LIB
#      define KMP_EXPAPI 
#  endif  /* ! KMPLIB_DLL */

#else
#	define KMP_EXPAPI 
#endif // _WINDOWS

#if defined(_MSC_VER)
#ifndef KMP_GLOBALCONST
#if defined( KMPLIB_DLL)
#define KMP_GLOBALCONST XOMP_GLOBALCONST
#define KMP_GLOBAL XOMP_GLOBAL
#define KMP_GLOBALAPI XOMP_GLOBALAPI
#elif defined( KMPLIB_STATIC)
#define KMP_GLOBALCONST XOMP_GLOBALCONST
#define KMP_GLOBAL XOMP_GLOBAL
#define KMP_GLOBALAPI XOMP_GLOBALAPI
#endif
#endif
#else
#define KMP_GLOBALCONST XOMP_GLOBALCONST
#define KMP_GLOBAL XOMP_GLOBAL
#define KMP_GLOBALAPI XOMP_GLOBALAPI
#endif

#endif /*KMP_EXP_H*/
